<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page session="true"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <jsp:include page="common/style.jsp" />
        <style>
#login-box {
	width: 230px;
	padding: 20px;
	margin: auto;
	background: #fff;
	-webkit-border-radius: 2px;
	-moz-border-radius: 2px;
	border: 1px solid #000;
        font-size: large;
}
</style>
    </head>

    <body>
        <c:if test="${pageContext.request.userPrincipal.name != null}">
        <div class="container">
        
            <jsp:include page="common/header.jsp" />
            <div class="hero-unit">
                <center>
                    <h2 class="form-signin-heading">Jesteś już zalogowany!</h2>
                    <a href="${pageContext.request.contextPath}/">Powrót do strony głównej</a>
                </center>
            </div>
        </div>
    </c:if>
    <c:if test="${pageContext.request.userPrincipal.name == null}">
    <div class="container">
        
            <jsp:include page="common/header.jsp" />
        <div class="hero-unit">
            <div id="login-box">

                    
                <h2 class="form-signin-heading">Załóż konto:</h2>
                    
                    <form name='loginForm' class="form-signin" role="form"
                            action="" method='POST'>
                                
                               
                            <input type="email" name='email1' class="input-block-level" placeholder="Email" required="required">
                            <input type="email" name='email2' class="input-block-level" placeholder="Powtórz Email" required="required">
                            
                            
                            <input type="password" name='password1' class="input-block-level" placeholder="Hasło" required="required" />
                            <input type="password" name='password2' class="input-block-level" placeholder="Powtórz hasło" required="required" />
                            
                            <input type="text" name='firstname' class="input-block-level" placeholder="Imię" required="required" />
                            <input type="text" name='lastname' class="input-block-level" placeholder="Nazwisko" required="required" />
                            <input type="number" name='phone' class="input-block-level" placeholder="Nr telefonu" required="required" />
                            
                            <button class="btn btn-lg btn-primary btn-block" name="submit" type="submit">Załóż konto</button>                                    

                            <input type="hidden" name="${_csrf.parameterName}"
                                    value="${_csrf.token}" />

                        </form>
                                   
                                    <a href="${pageContext.request.contextPath}/">Powrót do strony głównej</a>
                                    
            </div>
        </div>
                                
    </div>

    </c:if>
        <jsp:include page="common/footer.jsp" />
</body>
</html>